<template>
  <div class="app-container">
    <basic-container v-if="showSearch">
      <common-search @handleQuery="handleQuery" @resetQuery="resetQuery">
        <el-form :model="queryParams" ref="queryForm" :inline="true" size="mini" label-width="100px">
          <el-form-item label="采集列号" prop="seqNo">
            <el-input
              v-model="queryParams.seqNo"
              placeholder="请输入采集列号"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="海关编码" prop="customsCode">
            <el-input
              v-model="queryParams.customsCode"
              placeholder="请输入海关编码"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="场站编码" prop="fieldCode">
            <el-input
              v-model="queryParams.fieldCode"
              placeholder="请输入场站编码"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="通道编码" prop="channelNo">
            <el-input
              v-model="queryParams.channelNo"
              placeholder="请输入通道编码"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="进出口标志" prop="iEFlag">
            <el-input
              v-model="queryParams.iEFlag"
              placeholder="请输入进出口标志"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="进出场" prop="ieType">
            <el-select v-model="queryParams.ieType" placeholder="请选择进出场" clearable size="small">
              <el-option label="请选择字典生成" value="" />
            </el-select>
          </el-form-item>
          <el-form-item label="车辆海关编码" prop="veCustomsNo">
            <el-input
              v-model="queryParams.veCustomsNo"
              placeholder="请输入车辆海关编码"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="车牌号" prop="vehicleNo">
            <el-input
              v-model="queryParams.vehicleNo"
              placeholder="请输入车牌号"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="车辆自重" prop="emptyWt">
            <el-input
              v-model="queryParams.emptyWt"
              placeholder="请输入车辆自重"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="挂车重量" prop="trayWt">
            <el-input
              v-model="queryParams.trayWt"
              placeholder="请输入挂车重量"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="IC卡号" prop="cardNo">
            <el-input
              v-model="queryParams.cardNo"
              placeholder="请输入IC卡号"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="电子车牌" prop="rfid">
            <el-input
              v-model="queryParams.rfid"
              placeholder="请输入电子车牌"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="集装箱号" prop="contaNo">
            <el-input
              v-model="queryParams.contaNo"
              placeholder="请输入集装箱号"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="集装箱重量" prop="contaWt">
            <el-input
              v-model="queryParams.contaWt"
              placeholder="请输入集装箱重量"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="放行标识" prop="checkResult">
            <el-input
              v-model="queryParams.checkResult"
              placeholder="请输入放行标识"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="批次号" prop="manifestId">
            <el-input
              v-model="queryParams.manifestId"
              placeholder="请输入批次号"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="报关单号" prop="entryId">
            <el-input
              v-model="queryParams.entryId"
              placeholder="请输入报关单号"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="单证编号" prop="billCode">
            <el-input
              v-model="queryParams.billCode"
              placeholder="请输入单证编号"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="业务类型" prop="businessType">
            <el-select v-model="queryParams.businessType" placeholder="请选择业务类型" clearable size="small">
              <el-option label="请选择字典生成" value="" />
            </el-select>
          </el-form-item>
          <el-form-item label="过卡类型" prop="veGrossType">
            <el-select v-model="queryParams.veGrossType" placeholder="请选择过卡类型" clearable size="small">
              <el-option label="请选择字典生成" value="" />
            </el-select>
          </el-form-item>
          <el-form-item label="过卡重量" prop="crossWeight">
            <el-input
              v-model="queryParams.crossWeight"
              placeholder="请输入过卡重量"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="货物重量" prop="goodsWt">
            <el-input
              v-model="queryParams.goodsWt"
              placeholder="请输入货物重量"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="货物名称" prop="goodsName">
            <el-input
              v-model="queryParams.goodsName"
              placeholder="请输入货物名称"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="放行时间" prop="checkTime">
            <el-date-picker clearable size="small"
              v-model="queryParams.checkTime"
              type="date"
              value-format="yyyy-MM-dd HH:mm:ss"
              placeholder="选择放行时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="验放主体" prop="checkBody">
            <el-input
              v-model="queryParams.checkBody"
              placeholder="请输入验放主体"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="企业编码" prop="declCopCode">
            <el-input
              v-model="queryParams.declCopCode"
              placeholder="请输入企业编码"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="企业名称" prop="declCopName">
            <el-input
              v-model="queryParams.declCopName"
              placeholder="请输入企业名称"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-form>
      </common-search>
    </basic-container>
    <basic-container>
      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button
            type="primary"
            plain
            icon="el-icon-plus"
            size="mini"
            @click="handleAdd"
            v-hasPermi="['billsdecl:GkHdGather:add']"
          >新增</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="success"
            plain
            icon="el-icon-edit"
            size="mini"
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['billsdecl:GkHdGather:edit']"
          >修改</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="danger"
            plain
            icon="el-icon-delete"
            size="mini"
            :disabled="multiple"
            @click="handleDelete"
            v-hasPermi="['billsdecl:GkHdGather:remove']"
          >删除</el-button>
        </el-col>
      <!-- <el-col :span="1.5">
          <el-button
            type="warning"
            plain
            icon="el-icon-download"
            size="mini"
            :loading="exportLoading"
            @click="handleExport"
            v-hasPermi="['billsdecl:GkHdGather:export']"
          >导出</el-button>
        </el-col>
        -->
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>

      <el-table v-loading="loading" :data="GkHdGatherList" @selection-change="handleSelectionChange" @row-dblclick="showDetail"  stripe border>
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column label="企业名称" min-width="100" align="center" prop="id" />
        <el-table-column label="采集列号" min-width="100" align="center" prop="seqNo" />
        <el-table-column label="海关编码" align="center" prop="customsCode" min-width="100" />
        <el-table-column label="场站编码" align="center" prop="fieldCode" min-width="100" />
        <el-table-column label="场站名称" align="center" prop="fieldName" min-width="100" />
        <el-table-column label="通道编码" align="center" prop="channelNo" min-width="100" />
        <el-table-column label="通道名称" align="center" prop="channelName" min-width="100" />
        <el-table-column label="进出口标志" align="center" prop="iEFlag" min-width="100" />
        <el-table-column label="进出场" align="center" prop="ieType" min-width="100" />
        <el-table-column label="车辆海关编码" align="center" prop="veCustomsNo" min-width="100" />
        <el-table-column label="车牌号" align="center" prop="vehicleNo" min-width="100" />
        <el-table-column label="车辆自重" align="center" prop="emptyWt" min-width="100" />
        <el-table-column label="挂车重量" align="center" prop="trayWt" min-width="100" />
        <el-table-column label="IC卡号" align="center" prop="cardNo" min-width="100" />
        <el-table-column label="电子车牌" align="center" prop="rfid" min-width="100" />
        <el-table-column label="集装箱号" align="center" prop="contaNo" min-width="100" />
        <el-table-column label="集装箱重量" align="center" prop="contaWt" min-width="100"/>
        <el-table-column label="放行标识" align="center" prop="checkResult" min-width="100" />
        <el-table-column label="led显示" align="center" prop="ledHint" min-width="100" />
        <el-table-column label="批次号" align="center" prop="manifestId" min-width="100" />
        <el-table-column label="报关单号" align="center" prop="entryId" min-width="100" />
        <el-table-column label="单证编号" align="center" prop="billCode" min-width="100" />
        <el-table-column label="业务类型" align="center" prop="businessType" min-width="100" />
        <el-table-column label="过卡类型" align="center" prop="veGrossType" min-width="100" />
        <el-table-column label="过卡重量" align="center" prop="crossWeight" min-width="100" />
        <el-table-column label="货物重量" align="center" prop="goodsWt" min-width="100" />
        <el-table-column label="货物名称" align="center" prop="goodsName" min-width="100" />
        <el-table-column label="放行时间" align="center" prop="checkTime" min-width="100" >
        </el-table-column>
        <el-table-column label="验放主体" align="center" prop="checkBody" min-width="100" />
        <el-table-column label="企业编码" align="center" prop="declCopCode" min-width="100" />
        <el-table-column label="企业名称" align="center" prop="declCopName" min-width="100" />
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-view"
              @click="showDetail(scope.row)"
              v-hasPermi="['billsdecl:GkHdGather:query']"
            >详情</el-button>
            
            <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['billsdecl:GkHdGather:edit']"
            >修改</el-button>
            
            <el-button
              size="mini"
              type="text"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              v-hasPermi="['billsdecl:GkHdGather:remove']"
            >删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      
      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
    </basic-container>


    <!-- 添加或修改过卡记录对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false">
      <el-form ref="form" :model="form" :rules="rules" label-width="80px"  :disabled="isViewDisabled">
          <el-row>  
       		<el-col :span="12">
		        <el-form-item label="采集列号" prop="seqNo">
		          <el-input v-model="form.seqNo" placeholder="请输入采集列号" />
		        </el-form-item>
       		</el-col>
       		<el-col :span="12">
		        <el-form-item label="海关编码" prop="customsCode">
		          <el-input v-model="form.customsCode" placeholder="请输入海关编码" />
		        </el-form-item>
       		</el-col>
	  </el-row>
         <el-row>
       		<el-col :span="12">
		        <el-form-item label="场站编码" prop="fieldCode">
		          <el-input v-model="form.fieldCode" placeholder="请输入场站编码" />
		        </el-form-item>
       		</el-col>
       		<el-col :span="12">
		        <el-form-item label="场站名称" prop="fieldName">
		          <el-input v-model="form.fieldName" placeholder="请输入场站名称" />
		        </el-form-item>
       		</el-col>
	  </el-row>
         <el-row>
       		<el-col :span="12">
		        <el-form-item label="通道编码" prop="channelNo">
		          <el-input v-model="form.channelNo" placeholder="请输入通道编码" />
		        </el-form-item>
       		</el-col>
       		<el-col :span="12">
		        <el-form-item label="通道名称" prop="channelName">
		          <el-input v-model="form.channelName" placeholder="请输入通道名称" />
		        </el-form-item>
       		</el-col>
	  </el-row>
         <el-row>
       		<el-col :span="12">
		        <el-form-item label="进出口标志" prop="iEFlag">
		          <el-input v-model="form.iEFlag" placeholder="请输入进出口标志" />
		        </el-form-item>
       		</el-col>
       		<el-col :span="12">
		        <el-form-item label="进出场" prop="ieType">
		          <el-select v-model="form.ieType" placeholder="请选择进出场">
		            <el-option label="请选择字典生成" value="" />
		          </el-select>
		        </el-form-item>
       		</el-col>
	  </el-row>
         <el-row>
       		<el-col :span="12">
		        <el-form-item label="车辆海关编码" prop="veCustomsNo">
		          <el-input v-model="form.veCustomsNo" placeholder="请输入车辆海关编码" />
		        </el-form-item>
       		</el-col>
       		<el-col :span="12">
		        <el-form-item label="车牌号" prop="vehicleNo">
		          <el-input v-model="form.vehicleNo" placeholder="请输入车牌号" />
		        </el-form-item>
       		</el-col>
	  </el-row>
         <el-row>
       		<el-col :span="12">
		        <el-form-item label="车辆自重" prop="emptyWt">
		          <el-input v-model="form.emptyWt" placeholder="请输入车辆自重" />
		        </el-form-item>
       		</el-col>
       		<el-col :span="12">
		        <el-form-item label="挂车重量" prop="trayWt">
		          <el-input v-model="form.trayWt" placeholder="请输入挂车重量" />
		        </el-form-item>
       		</el-col>
	  </el-row>
         <el-row>
       		<el-col :span="12">
		        <el-form-item label="IC卡号" prop="cardNo">
		          <el-input v-model="form.cardNo" placeholder="请输入IC卡号" />
		        </el-form-item>
       		</el-col>
       		<el-col :span="12">
		        <el-form-item label="电子车牌" prop="rfid">
		          <el-input v-model="form.rfid" placeholder="请输入电子车牌" />
		        </el-form-item>
       		</el-col>
	  </el-row>
         <el-row>
       		<el-col :span="12">
		        <el-form-item label="集装箱号" prop="contaNo">
		          <el-input v-model="form.contaNo" placeholder="请输入集装箱号" />
		        </el-form-item>
       		</el-col>
       		<el-col :span="12">
		        <el-form-item label="集装箱重量" prop="contaWt">
		          <el-input v-model="form.contaWt" placeholder="请输入集装箱重量" />
		        </el-form-item>
       		</el-col>
	  </el-row>
         <el-row>
       		<el-col :span="12">
		        <el-form-item label="放行标识" prop="checkResult">
		          <el-input v-model="form.checkResult" placeholder="请输入放行标识" />
		        </el-form-item>
       		</el-col>
       		<el-col :span="12">
		        <el-form-item label="led显示" prop="ledHint">
		          <el-input v-model="form.ledHint" type="textarea" placeholder="请输入内容" />
		        </el-form-item>
       		</el-col>
	  </el-row>
         <el-row>
       		<el-col :span="12">
		        <el-form-item label="批次号" prop="manifestId">
		          <el-input v-model="form.manifestId" placeholder="请输入批次号" />
		        </el-form-item>
       		</el-col>
       		<el-col :span="12">
		        <el-form-item label="报关单号" prop="entryId">
		          <el-input v-model="form.entryId" placeholder="请输入报关单号" />
		        </el-form-item>
       		</el-col>
	  </el-row>
         <el-row>
       		<el-col :span="12">
		        <el-form-item label="单证编号" prop="billCode">
		          <el-input v-model="form.billCode" placeholder="请输入单证编号" />
		        </el-form-item>
       		</el-col>
       		<el-col :span="12">
		        <el-form-item label="业务类型" prop="businessType">
		          <el-select v-model="form.businessType" placeholder="请选择业务类型">
		            <el-option label="请选择字典生成" value="" />
		          </el-select>
		        </el-form-item>
       		</el-col>
	  </el-row>
         <el-row>
       		<el-col :span="12">
		        <el-form-item label="过卡类型" prop="veGrossType">
		          <el-select v-model="form.veGrossType" placeholder="请选择过卡类型">
		            <el-option label="请选择字典生成" value="" />
		          </el-select>
		        </el-form-item>
       		</el-col>
       		<el-col :span="12">
		        <el-form-item label="过卡重量" prop="crossWeight">
		          <el-input v-model="form.crossWeight" placeholder="请输入过卡重量" />
		        </el-form-item>
       		</el-col>
	  </el-row>
         <el-row>
       		<el-col :span="12">
		        <el-form-item label="货物重量" prop="goodsWt">
		          <el-input v-model="form.goodsWt" placeholder="请输入货物重量" />
		        </el-form-item>
       		</el-col>
       		<el-col :span="12">
		        <el-form-item label="货物名称" prop="goodsName">
		          <el-input v-model="form.goodsName" placeholder="请输入货物名称" />
		        </el-form-item>
       		</el-col>
	  </el-row>
         <el-row>
       		<el-col :span="12">
		        <el-form-item label="放行时间" prop="checkTime">
		          <el-date-picker clearable size="small"
		            v-model="form.checkTime"
		            type="date"
		            value-format="yyyy-MM-dd HH:mm:ss"
		            placeholder="选择放行时间">
		          </el-date-picker>
		        </el-form-item>
       		</el-col>
       		<el-col :span="12">
		        <el-form-item label="验放主体" prop="checkBody">
		          <el-input v-model="form.checkBody" placeholder="请输入验放主体" />
		        </el-form-item>
       		</el-col>
	  </el-row>
         <el-row>
       		<el-col :span="12">
		        <el-form-item label="企业编码" prop="declCopCode">
		          <el-input v-model="form.declCopCode" placeholder="请输入企业编码" />
		        </el-form-item>
       		</el-col>
       		<el-col :span="12">
		        <el-form-item label="企业名称" prop="declCopName">
		          <el-input v-model="form.declCopName" placeholder="请输入企业名称" />
		        </el-form-item>
       		</el-col>
	  </el-row>
         <el-row>
	   </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm" v-if="!isViewDisabled">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 详情dialog-->
    <el-dialog :visible.sync="detailOpen" width="50%" append-to-body :close-on-click-modal="false">
       <el-descriptions class="margin-top" title="过卡记录详情" :column="3"  border>
		 <el-descriptions-item>
		        <template slot="label">
		         采集列号
		        </template>
		       {{form.seqNo}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         海关编码
		        </template>
		       {{form.customsCode}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         场站编码
		        </template>
		       {{form.fieldCode}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         场站名称
		        </template>
		       {{form.fieldName}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         通道编码
		        </template>
		       {{form.channelNo}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         通道名称
		        </template>
		       {{form.channelName}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         进出口标志
		        </template>
		       {{form.iEFlag}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         进出场
		        </template>
		       {{form.ieType}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         车辆海关编码
		        </template>
		       {{form.veCustomsNo}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         车牌号
		        </template>
		       {{form.vehicleNo}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         车辆自重
		        </template>
		       {{form.emptyWt}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         挂车重量
		        </template>
		       {{form.trayWt}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         IC卡号
		        </template>
		       {{form.cardNo}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         电子车牌
		        </template>
		       {{form.rfid}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         集装箱号
		        </template>
		       {{form.contaNo}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         集装箱重量
		        </template>
		       {{form.contaWt}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         放行标识
		        </template>
		       {{form.checkResult}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         led显示
		        </template>
		       {{form.ledHint}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         批次号
		        </template>
		       {{form.manifestId}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         报关单号
		        </template>
		       {{form.entryId}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         单证编号
		        </template>
		       {{form.billCode}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         业务类型
		        </template>
		       {{form.businessType}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         过卡类型
		        </template>
		       {{form.veGrossType}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         过卡重量
		        </template>
		       {{form.crossWeight}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         货物重量
		        </template>
		       {{form.goodsWt}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         货物名称
		        </template>
		       {{form.goodsName}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         放行时间
		        </template>
		       {{form.checkTime}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         验放主体
		        </template>
		       {{form.checkBody}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         企业编码
		        </template>
		       {{form.declCopCode}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         企业名称
		        </template>
		       {{form.declCopName}}
		  </el-descriptions-item>
		 <el-descriptions-item>
		        <template slot="label">
		         创建时间
		        </template>
		       {{form.createTime}}
		  </el-descriptions-item>
         </el-descriptions>  
        <div slot="footer" class="dialog-footer" style="text-align: center;">
          <el-button @click="closeDetail">关闭</el-button>
        </div>
    </el-dialog>
  </div>
</template>

<script>
import { listGkHdGather, getGkHdGather, delGkHdGather, addGkHdGather, updateGkHdGather, exportGkHdGather } from "@/api/billsdecl/GkHdGather";

export default {
  name: "GkHdGather",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
       //详情显示的时候，表单编辑禁用
      isViewDisabled:false,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 过卡记录表格数据
      GkHdGatherList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
       //显示详情
      detailOpen:false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        seqNo: null,
        customsCode: null,
        fieldCode: null,
        channelNo: null,
        iEFlag: null,
        ieType: null,
        veCustomsNo: null,
        vehicleNo: null,
        emptyWt: null,
        trayWt: null,
        cardNo: null,
        rfid: null,
        contaNo: null,
        contaWt: null,
        checkResult: null,
        ledHint: null,
        manifestId: null,
        entryId: null,
        billCode: null,
        businessType: null,
        veGrossType: null,
        crossWeight: null,
        goodsWt: null,
        goodsName: null,
        checkTime: null,
        checkBody: null,
        declCopCode: null,
        declCopName: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询过卡记录列表 */
    getList() {
      this.loading = true;
      listGkHdGather(this.queryParams).then(response => {
        this.GkHdGatherList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        seqNo: null,
        customsCode: null,
        fieldCode: null,
        fieldName: null,
        channelNo: null,
        channelName: null,
        iEFlag: null,
        ieType: null,
        veCustomsNo: null,
        vehicleNo: null,
        emptyWt: null,
        trayWt: null,
        cardNo: null,
        rfid: null,
        contaNo: null,
        contaWt: null,
        checkResult: null,
        ledHint: null,
        manifestId: null,
        entryId: null,
        billCode: null,
        businessType: null,
        veGrossType: null,
        crossWeight: null,
        goodsWt: null,
        goodsName: null,
        checkTime: null,
        checkBody: null,
        declCopCode: null,
        declCopName: null,
        createTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.isViewDisabled=false;
      this.open = true;
      this.title = "添加过卡记录";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      this.load(id);
      this.title = "修改过卡记录";
      this.open = true;
    },
    //关闭详情
    closeDetail(){
      this.detailOpen=false;
    },
     //显示详情
    showDetail(row, column, event){
        this.reset();
        //关闭表单编辑模式
        this.isViewDisabled=true;
        const id = row.id;
        this.load(id);
          //打开详情
        this.detailOpen=true;
    },
     /** 加载数据 */
    load(id){
	    getGkHdGather(id).then(response => {
          this.form = response.data;
                  });
	},
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateGkHdGather(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addGkHdGather(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除过卡记录编号为"' + ids + '"的数据项？').then(function() {
        return delGkHdGather(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$modal.confirm('是否确认导出所有过卡记录数据项？').then(() => {
        this.exportLoading = true;
        return exportGkHdGather(queryParams);
      }).then(response => {
        this.download(response.msg);
        this.exportLoading = false;
      }).catch(() => {});
    }
  }
};
</script>
